<property name="restrict-to-fill-level">0</property>
<property name="fill-level">75</property>
<property name="digits">-1</property>
+ <property name="draw-value">1</property>
<property name="halign">end</property>
</object>
</child>
<property name="restrict-to-fill-level">0</property>
<property name="fill-level">75</property>
<property name="digits">-1</property>
+ <property name="draw-value">1</property>
<property name="halign">start</property>
</object>
</child>
gtk_search_entry_set_key_capture_widget() and
gtk_event_controller_key_forward().
+### Adapt to GtkScale changes
+
+The default value of #GtkScale:draw-value has been changed to %FALSE.
+If you want your scales to draw values, you will have to set this
+property explicitly now.
+
+gtk4-builder-tool can help with this conversion, with the --3to4 option
+of the simplify command.
+
### Stop using gtk_window_activate_default()
The handling of default widgets has been changed, and activating
g_param_spec_boolean ("draw-value",
P_("Draw Value"),
P_("Whether the current value is displayed as a string next to the slider"),
- TRUE,
+ FALSE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
properties[PROP_HAS_ORIGIN] =
_gtk_range_set_has_origin (range, TRUE);
- gtk_scale_set_draw_value (scale, TRUE);
gtk_range_set_round_digits (range, priv->digits);
gtk_range_set_flippable (range, TRUE);
}
}
+static gboolean
+has_prop (Element *element,
+ MyParserData *data,
+ const char *prop_name)
+{
+ GList *l;
+
+ for (l = element->children; l; l = l->next)
+ {
+ Element *child = l->data;
+
+ if (g_str_equal (child->element_name, "property") &&
+ has_attribute (child, "name", prop_name))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static void
+rewrite_scale (Element *element,
+ MyParserData *data)
+{
+ if (!has_prop (element, data, "draw-value") &&
+ !has_prop (element, data, "draw_value"))
+ {
+ Element *child;
+ child = g_new0 (Element, 1);
+ child->parent = element;
+ child->element_name = g_strdup ("property");
+ child->attribute_names = g_new0 (char *, 2);
+ child->attribute_names[0] = g_strdup ("name");
+ child->attribute_values = g_new0 (char *, 2);
+ child->attribute_values[0] = g_strdup ("draw-value");
+ child->data = g_strdup ("1");
+ element->children = g_list_prepend (element->children, child);
+ }
+}
+
/* returns TRUE to remove the element from the parent */
static gboolean
simplify_element (Element *element,
g_str_equal (get_class_name (element), "GtkRadioButton"))
rewrite_radio_button (element, data);
+ if (element_is_object_or_template (element) &&
+ g_str_equal (get_class_name (element), "GtkScale"))
+ rewrite_scale (element, data);
+
if (g_str_equal (element->element_name, "property"))
maybe_rename_property (element, data);
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<property name="adjustment">adjustment1</property>
+ <property name="draw-value">1</property>
</object>
</child>
<child>
<property name="orientation">horizontal</property>
<property name="adjustment">adjustment1</property>
<property name="value-pos">bottom</property>
+ <property name="draw-value">1</property>
</object>
</child>
<child>
<property name="restrict-to-fill-level">0</property>
<property name="fill-level">75</property>
<property name="digits">-1</property>
+ <property name="draw-value">1</property>
<property name="halign">end</property>
</object>
</child>
<property name="restrict-to-fill-level">0</property>
<property name="fill-level">75</property>
<property name="digits">-1</property>
+ <property name="draw-value">1</property>
<property name="halign">start</property>
</object>
</child>
<property name="restrict-to-fill-level">0</property>
<property name="fill-level">75</property>
<property name="digits">-1</property>
+ <property name="draw-value">1</property>
<property name="halign">end</property>
</object>
</child>
<property name="restrict-to-fill-level">0</property>
<property name="fill-level">75</property>
<property name="digits">-1</property>
+ <property name="draw-value">1</property>
<property name="halign">start</property>
</object>
</child>
<property name="restrict-to-fill-level">0</property>
<property name="fill-level">75</property>
<property name="digits">-1</property>
+ <property name="draw-value">1</property>
<property name="halign">end</property>
</object>
</child>
<property name="restrict-to-fill-level">0</property>
<property name="fill-level">75</property>
<property name="digits">-1</property>
+ <property name="draw-value">1</property>
<property name="halign">start</property>
</object>
</child>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkScale">
+ <property name="draw-value">1</property>
+ <property name="visible">0</property>
+ </object>
+ <object class="GtkScale">
+ <property name="visible">0</property>
+ <property name="draw-value">1</property>
+ </object>
+ <object class="GtkScale">
+ <property name="visible">0</property>
+ </object>
+</interface>
--- /dev/null
+<interface>
+ <object class="GtkScale">
+ </object>
+ <object class="GtkScale">
+ <property name="draw-value">1</property>
+ </object>
+ <object class="GtkScale">
+ <property name="draw_value">0</property>
+ </object>
+</interface>